package com.imooc.demo;

import org.quartz.*;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @ClassName HelloJob
 * @Description TODO
 * @Author Wxg
 * @Date 2018/11/13 17:47
 * @Version 1.0
 */
public class HelloJobV2 implements Job {
    @Override
    public void execute(JobExecutionContext context) {
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println("Current Exec Time is : " + sdf.format(date));

        System.out.println("Hello World!");

        JobKey jobKey = context.getJobDetail().getKey();
        TriggerKey triggerKey = context.getTrigger().getKey();

        JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
        JobDataMap triggerDataMap = context.getTrigger().getJobDataMap();

        JobDataMap mergedJobDataMap = context.getMergedJobDataMap();

        // 从中获取数据的代码就不写了。
    }
}
